import { EnvEnum } from '../enums/env.enum';
import * as dotenv from 'dotenv';
import { envFilePath as path } from './constants';

dotenv.config({ path })

export const loadEnvConfig = (): Record<EnvEnum, unknown> => {
  return {
    APP_ENV: process.env.APP_ENV,
    APP_PORT: process.env.APP_PORT,
    DATABASE_URL: process.env.DATABASE_URL,
    JWT_ACCESS_TOKEN_EXPIRES_IN: process.env.JWT_ACCESS_TOKEN_EXPIRES_IN,
    JWT_REFRESH_TOKEN_EXPIRES_IN: process.env.JWT_REFRESH_TOKEN_EXPIRES_IN,
    JWT_PRIVATE_KEY: process.env.JWT_PRIVATE_KEY,
    JWT_PUBLIC_KEY: process.env.JWT_PUBLIC_KEY,
    LOG_LEVEL: process.env.LOG_LEVEL,
    TIMESTAMP: process.env.TIMESTAMP,
    LOG_ON: process.env.LOG_ON,
    REDIS_HOST: process.env.REDIS_HOST,
    REDIS_PASSWORD: process.env.REDIS_PASSWORD,
    REDIS_PORT: process.env.REDIS_PORT,
    EMAIL_HOST: process.env.EMAIL_HOST,
    EMAIL_PORT: process.env.EMAIL_PORT,
    EMAIL_NAME: process.env.EMAIL_NAME,
    EMAIL_USER: process.env.EMAIL_USER,
    EMAIL_PASS: process.env.EMAIL_PASS,
    UPLOAD_ADDRESS: process.env.UPLOAD_ADDRESS,
  };
};
